<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <canvas id="ctx" width="1000" height="1000" style="background-color: #eee;"></canvas>
</body>
</html>

<script>

const canvas = document.querySelector('#ctx')
const ctx = canvas.getContext('2d')

ctx.fillStyle = "rgb(200,0,0)";
ctx.fillRect (10, 10, 500, 500);

ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
ctx.fillRect (200, 200, 500, 500);

ctx.fillStyle = "rgba(0, 200, 0, 0.5)";
ctx.fillRect (400, 400, 500, 500);

</script>